﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Web.Http;
using System.Net.Http;
using System.Web.Http.SelfHost;

namespace Console_Api
{
    class Program
    {
        static void Main(string[] args)
        {
          
            var config = new HttpSelfHostConfiguration("http://localhost:8080");
            config.Routes.MapHttpRoute("Default","api/{controller}/{id}",new {id=RouteParameter.Optional });
            using (HttpSelfHostServer server=new HttpSelfHostServer(config))
            {
                server.OpenAsync().Wait();
                Console.WriteLine("Press Enter to quit");
                Console.ReadLine();
            }
        }
    }
}
